package com.liuche.rpc.serializer;

import com.liuche.rpc.utils.SpiLoader;

/**
 * @Author 刘彻
 * @Date 2024/4/17 13:51
 * @PackageName: com.liuche.rpc.serializer
 * @ClassName: SerializerFactory
 * @Description: 序列化器工厂用来获取指定的序列化器
 */
public class SerializerFactory {
    static {
        SpiLoader.load(Serializer.class);
    }

    // 根据意愿指定序列化器
    public static Serializer getSerializer(String serializeKey) {
        return SpiLoader.getInstance(Serializer.class, serializeKey);
    }
}
